package cn.aiweiyi.qingjing.coupon.distribution.dao;

import cn.aiweiyi.qingjing.coupon.comm.constant.CouponStatus;
import cn.aiweiyi.qingjing.coupon.distribution.entity.Coupon;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Coupon持久化接口定义
 */
public interface CouponDao extends JpaRepository<Coupon, Integer> {
    /**
     * 根据 userId+状态寻找优惠券记录
     * where userId=... and status=...
     */
    List<Coupon> findAllByUserIdAndStatus(Long userId, CouponStatus status);


}
